< previous page page_142 next page >

Page 142
Click the Multi-Dimension command button on the Arrays.frm file to view the following code for creating a multidimensional array:
9f31265bb40b592b1929e18a47ab28e5.gif
Private Sub cmdMulti_Click()
   Const conSSN As Integer = 0
   Const conName As Integer = 1
   Const conSalary As Integer = 2

   ' Create the Array
   Dim avntEmployees(3, 2) As Variant

   avntEmployees(0, conSSN) = "555-55-5555"
   avntEmployees(0, conName) = "Paul"
   avntEmployees(0, conSalary) = 100000

   avntEmployees(1, conSSN) = "123-45-6789"
   avntEmployees(1, conName) = "Ken"
   avntEmployees(1, conSalary) = 150000

   avntEmployees(2, conSSN) = "987-65-4321"
   avntEmployees(2, conName) = "Bill"
   avntEmployees(2, conSalary) = 60000

   avntEmployees(3, conSSN) = "333-33-3333"
   avntEmployees(3, conName) = "Tom"
   avntEmployees(3, conSalary) = 90000

   ' Retrieve SSNs, Names & Salaries
   Me.Cls
   Me.Print avntEmployees(0, conSSN), _
           avntEmployees(0, conName), _
           avntEmployees(0, conSalary)
   Me.Print avntEmployees(1, conSSN), _
           avntEmployees(1, conName), _
           avntEmployees(1, conSalary)
   Me.Print avntEmployees(2, conSSN), _
           avntEmployees(2, conName), _
           avntEmployees(2, conSalary)

 
< previous page page_142 next page >

If you like this book, buy it!